﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MvcMusicStore.Models;
using LibraryMusicStore;
using MvcMusicStore.Infrastructure.Extensions;
using MvcMusicStore.Infrastructure.Config;

namespace MvcMusicStore.Controllers
{
    [HandleError]
    //[LogRequest]
    public class BaseController : Controller
    {
        public User CurrentUser
        {
            get
            {
                var principal = User as EnhancedPrincipal;
                return principal == null ? null : principal.Data;
            }
        }

        public ActionResult RedirectToLogin()
        {
            return RedirectToAction("LogOn", "Account", new { returnUrl = Request.Path });
        }
    }
}
